import json
import asyncio

from parser import parse_video_share_url, parse_video_id, VideoSource

# 根据分享链接解析
video_info = asyncio.run(parse_video_share_url("https://v.douyin.com/VuRg-PVN_cI/"))
# video_info = asyncio.run(parse_video_share_url("https://weibo.com/tv/show/1034:5211838661459997?mid=5211838780277721"))
# video_info = asyncio.run(parse_video_share_url("https://www.kuaishou.com/f/X-1gl18lNXSfD29z"))
# video_info = asyncio.run(parse_video_share_url("https://v.douyin.com/0CCWkKwKIZE/"))
# video_info = asyncio.run(parse_video_share_url("https://weibo.com/tv/show/1034:5211838661459997?mid=5211838780277721"))



print(
    "解析分享链接：\n",
    json.dumps(video_info, ensure_ascii=False, indent=4, default=lambda x: x.__dict__),
    "\n",
)

# # 根据视频id解析
# video_info = asyncio.run(
#     parse_video_id(VideoSource.DouYin, "视频ID")
# )
# print(
#     "解析视频ID：\n",
#     json.dumps(video_info, ensure_ascii=False, indent=4, default=lambda x: x.__dict__),
#     "\n",
# )